{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">文章列表</li>
            <li class=""><a href="{:url('admin/article/add')}">添加文章</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-inline">
                <button class="layui-btn layui-btn-sm" id="export">导出 Word</button>
            </div>


            <div class="layui-tab-item layui-show">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>标题</th>
                        <th>封面</th>
                        <th>点击量</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name='list' id='a'}
                    <tr>
                        <td>{$a.id}</td>
                        <td>{$a.title}</td>
                        <td><img src="{$a.cover_pic}"></td>
                        <td>{$a.click_num}</td>
                        <td>{$a.create_time}</td>
                        <td>
                            <a href="{:url('admin/article/comment',['id'=>$a['id']])}" 	class="layui-btn layui-btn-normal layui-btn-xs">评论</a>
                            <a href="{:url('admin/article/add',['id'=>$a['id']])}" class="layui-btn layui-btn-warm layui-btn-xs">编辑</a>
                            <a href="{:url('admin/article/delete',['id'=>$a['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete layui-btn-xs">删除</a>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
                {$list|raw}
            </div>
        </div>
    </div>
</div>
{/block}


{block name="script"}
<script>

    $('#export').on('click',function(){
        window.location.href = '{:url("admin/article/export")}';
    })


</script>
{/block}
